/* 
 * String.prototype.toLowerCase() 转小写
 * String.prototype.toUpperCase() 转大写
 * String.prototype.toLocaleLowerCase()
 * String.prototype.toLocaleUpperCase()
 * 
 * String.prototype.trim() 剔除首尾空白
 * String.prototype.trimEnd()  剔除尾部空白
 * String.prototype.trimStart()  剔除首部空白
 * 
 * String.prototype.valueOf()
 * String.prototype.toString()
 */

let origin = 'Hello World .' ;
console.log( origin );

let upper = origin.toUpperCase();
console.log( upper );

let lower = origin.toLowerCase();
console.log( lower );

let username = '    wang li      ' ;
console.log( username.length );

let s1 = username.trimStart() ; // 剔除首部空白
console.log( s1.length );

let s2 = username.trimEnd() ; // 剔除尾部空白
console.log( s2.length );

let s3 = username.trim() ; // 剔除首尾空白
console.log( s3.length );

let instance = new String( '咋不休息呢?' );
console.log( instance , typeof instance );

let primitive = instance.valueOf();
console.log( primitive , typeof primitive );

let str = instance.toString();
console.log( str );